home *** CD-ROM | disk | FTP | other *** search
Wrap
package com.extensibility.xa; import com.extensibility.app.BaseAction; import com.extensibility.app.UI; import com.extensibility.rock.BaseMenu; import com.extensibility.rock.RAction; import com.extensibility.rock.RJMenu; import com.extensibility.rock.ScrollPop; import com.extensibility.rock.table.QlickerCellEditor; import com.extensibility.rock.table.QlickerDataSource; import com.extensibility.xml.dt.DataTypeFactory; import com.extensibility.xml.dt.DataTypeIntf; import com.extensibility.xml.dt.Facet; import java.awt.Color; import java.awt.FlowLayout; import java.awt.Font; import java.awt.event.MouseEvent; import java.util.Enumeration; import javax.swing.AbstractButton; import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JCheckBoxMenuItem; import javax.swing.JMenuItem; import javax.swing.JPanel; import javax.swing.JPopupMenu; import javax.swing.SwingUtilities; import javax.swing.text.Document; import javax.swing.text.JTextComponent; public class OptionsQlicker extends QlickerCellEditor { final Color FRAME_COLOR = UI.getColor(2); final Color BTN_COLOR = UI.getColor(1); Icon icnPop = UI.getIcon("pop.gif"); public static final String POPUP_DATA = "OPTIONS"; public static final String REUSABLES = "REUSABLES"; QlickerBtn btnNotationList; SchemaDoc doc; RAction actionListener = new 1(this); RAction createAction = new 2(this); RAction editAction = new 3(this); RAction digitsAction = new 4(this); RAction decimalsAction = new 5(this); RAction minAction = new 6(this); RAction maxAction = new 7(this); BaseAction minExcludeAction = new 8(this, "oq.minexclusive"); BaseAction maxExcludeAction = new 9(this, "oq.maxexclusive"); RAction enumerationAction = new 10(this); RAction lengthAction = new 11(this); RAction maxLengthAction = new 12(this); RAction minLengthAction = new 13(this); RAction patternAction = new 14(this); RAction encodingAction = new 15(this); RAction periodAction = new 16(this); public OptionsQlicker(SchemaDoc var1, QlickerDataSource var2) { super(var2); this.doc = var1; } protected JPanel createButtonPanel() { super.btnPanel = new JPanel(); super.btnPanel.setBorder(BorderFactory.createLineBorder(this.FRAME_COLOR)); FlowLayout var1 = new FlowLayout(); var1.setHgap(0); var1.setVgap(0); super.btnPanel.setLayout(var1); Font var2 = new Font("Dialog", 0, 9); super.btnPanel.setFont(var2); this.btnNotationList = new QlickerBtn(UI.getString("oq.options"), this.icnPop); this.btnNotationList.setBackground(this.BTN_COLOR); this.btnNotationList.addMouseListener(new Popper(this)); super.btnPanel.add(this.btnNotationList); super.btnPanel.setSize(super.btnPanel.getLayout().preferredLayoutSize(super.btnPanel)); return super.btnPanel; } private SchemaDoc getSchemaDoc() { return this.doc; } protected Document createDocument() { return new OptionsDocument(this); } public void insertName(String var1) { if (((QlickerCellEditor)this).needsChar(((QlickerCellEditor)this).getText(), ((JTextComponent)this).getSelectionStart(), '|')) { var1 = String.valueOf("| ").concat(String.valueOf(var1)); } ((JTextComponent)this).replaceSelection(var1); } public JPanel adoptBtnPanel() { super.btnPanel.remove(0); super.btnPanel.revalidate(); return super.adoptBtnPanel(); } private SchemaWin getSchemaWin() { return (SchemaWin)SwingUtilities.windowForComponent(this); } protected JPopupMenu createPopup(MouseEvent var1) { return this.createPopup((ScrollPop)super.createPopup(var1)); } protected ScrollPop createPopdown() { return this.createPopup((ScrollPop)null); } protected ScrollPop createPopup(ScrollPop var1) { if (var1 == null) { var1 = new ScrollPop(); } else { var1.addSeparator(); } BaseMenu var3 = new BaseMenu(UI.getString("oq.structure")); JMenuItem var2 = ((RJMenu)var3).add(UI.getString("oq.create")); ((AbstractButton)var2).addActionListener(this.createAction); var2 = ((RJMenu)var3).add(UI.getString("oq.edit")); ((AbstractButton)var2).addActionListener(this.editAction); var3.addSeparator(); if (super.dataSource != null) { Enumeration var4 = (Enumeration)super.dataSource.getQlickerData("REUSABLES", new Integer(super.table.getEditingRow())); while(var4.hasMoreElements()) { String var5 = (String)var4.nextElement(); var2 = var3.add(new JMenuItem(var5)); ((AbstractButton)var2).addActionListener(this.actionListener); } } if (this.getSchemaDoc().getSchema().isSupported("GESTALT_REUSABLE_CONSTRAINTS") || this.getSchemaDoc().getSchema().isSupported("GESTALT_REUSABLE_TEXT")) { var1.add(var3); var1.addSeparator(); } boolean var25 = true; var2 = ((JPopupMenu)var1).add(UI.getString("oq.digits")); ((AbstractButton)var2).addActionListener(this.digitsAction); var2.setEnabled(this.getSchemaDoc().isSupported("GESTALT_FACET_DIGITS")); var2 = ((JPopupMenu)var1).add(UI.getString("oq.decimals")); ((AbstractButton)var2).addActionListener(this.decimalsAction); var2.setEnabled(this.getSchemaDoc().isSupported("GESTALT_FACET_DECIMALS")); var2 = ((JPopupMenu)var1).add(UI.getString("oq.min")); ((AbstractButton)var2).addActionListener(this.minAction); var2.setEnabled(this.getSchemaDoc().isSupported("GESTALT_FACET_MIN")); var2 = ((JPopupMenu)var1).add(UI.getString("oq.max")); ((AbstractButton)var2).addActionListener(this.maxAction); var2.setEnabled(this.getSchemaDoc().isSupported("GESTALT_FACET_MAX")); DataTypeIntf var26 = DataTypeFactory.createDataType(DataTypeIntf.NUMBER).setOptions(((QlickerCellEditor)this).getText()); Facet var6 = var26.getFacet(Facet.FACET_MINEX_NAME); JCheckBoxMenuItem var15 = var1.addAsCheckBox(this.minExcludeAction); ((JMenuItem)var15).setEnabled(this.getSchemaDoc().isSupported("GESTALT_FACET_MINEX")); if (var6 != null) { ((AbstractButton)var15).setSelected(((String)var6.getValue()).equals("true")); } else { ((AbstractButton)var15).setSelected(false); } var15 = var1.addAsCheckBox(this.maxExcludeAction); ((JMenuItem)var15).setEnabled(this.getSchemaDoc().isSupported("GESTALT_FACET_MAXEX")); var6 = var26.getFacet(Facet.FACET_MAXEX_NAME); if (var6 != null) { ((AbstractButton)var15).setSelected(((String)var6.getValue()).equals("true")); } else { ((AbstractButton)var15).setSelected(false); } var1.addSeparator(); JMenuItem var17 = ((JPopupMenu)var1).add(UI.getString("oq.enumeration")); ((AbstractButton)var17).addActionListener(this.enumerationAction); var17.setEnabled(this.getSchemaDoc().isSupported("GESTALT_FACET_ENUM")); var1.addSeparator(); var17 = ((JPopupMenu)var1).add(UI.getString("oq.length")); ((AbstractButton)var17).addActionListener(this.lengthAction); var17.setEnabled(this.getSchemaDoc().isSupported("GESTALT_FACET_LENGTH")); var17 = ((JPopupMenu)var1).add(UI.getString("oq.maxlength")); ((AbstractButton)var17).addActionListener(this.maxLengthAction); var17.setEnabled(this.getSchemaDoc().isSupported("GESTALT_FACET_MAXLENGTH")); var17 = ((JPopupMenu)var1).add(UI.getString("oq.minlength")); ((AbstractButton)var17).addActionListener(this.minLengthAction); var17.setEnabled(this.getSchemaDoc().isSupported("GESTALT_FACET_MINLENGTH")); var1.addSeparator(); var17 = ((JPopupMenu)var1).add(UI.getString("oq.pattern")); ((AbstractButton)var17).addActionListener(this.patternAction); var17.setEnabled(this.getSchemaDoc().isSupported("GESTALT_FACET_PATTERN")); var17 = ((JPopupMenu)var1).add(UI.getString("oq.encoding")); ((AbstractButton)var17).addActionListener(this.encodingAction); var17.setEnabled(this.getSchemaDoc().isSupported("GESTALT_FACET_ENCODING")); var17 = ((JPopupMenu)var1).add(UI.getString("oq.period")); ((AbstractButton)var17).addActionListener(this.periodAction); var17.setEnabled(this.getSchemaDoc().isSupported("GESTALT_FACET_PERIOD")); if (super.dataSource != null) { Enumeration var7 = (Enumeration)super.dataSource.getQlickerData("OPTIONS", new Integer(super.table.getEditingRow())); while(var7.hasMoreElements()) { String var8 = (String)var7.nextElement(); var17 = var1.add(new JMenuItem(var8)); ((AbstractButton)var17).addActionListener(this.actionListener); } } return var1; } // $FF: synthetic method static SchemaWin access$7000071(OptionsQlicker var0) { return var0.getSchemaWin(); } }